<template>
	<v-select v-if="classname" v-model="value_in" :items="dicts[classname]" :label="label" :singleLine="singleLine"
						:hideDetails="hideDetails" :clearable="clearable"></v-select>
	<v-select v-else v-model="value_in" :items="items" :label="label" :singleLine="singleLine" :hideDetails="hideDetails"
						:clearable="clearable"></v-select>
</template>

<script>
  import mixin_input from './mixin_input'

  export default {
    name: "zzselect",
    mixins: [
      mixin_input,
    ],
    props: {
      map: [Object],// Map<value,label>
      classname: null,// String
      singleLine: {type: Boolean, default: () => true,},
      items: [Array], // List<Map<String，String>>
      excludes: {type: Array, default: () => [],}, // List<String>
    },
    data() {
      return {}
    },
    watch: {},
    created() {
      this.init()
    },
    methods: {
      async init() {
        this.classname && this.zzloadDicts([this.classname])
        if (empty(this.items) && noempty(this.map)) {
          this.items = []
          this.zzforEach(this.map, (value, text) => {//(value, text) 对应 Map<key, value>
            if (!this.excludes.contains(key)) {
              this.items.push({value, text})
            }
          })
        }
      },
    }
  };
</script>
<style scoped lang="scss">

</style>
